<?php
	require "settings/config.php";
	require "layout.php";
	require "includes/sql_functions.php";
	require "includes/slot_functions.php";
	require "includes/session.php";
	
	oh_require_admin();
	
	if($_POST['year']!="" && $_POST['month']!="" && $_POST['day']!="" && $_POST['hour']!="" && $_POST['minute']!="" && $_POST['duration']>0)
	{

		$result=(oh_slot_add($_POST['year'],$_POST['month'],$_POST['day'],$_POST['hour'],$_POST['minute'],$_POST['duration']));
		
		if($result=="invalid")
			header('Location: slots.php?baddate=1');
			
		if($result=="success")
			header('Location: slots.php?success=1');
	}
	else
	{
		header('Location: slots.php?baddate=1');
	}

?>
